package com.ponhu.ea2.stockcenter.provider.support.enums;

/**
 * 单据占用状态
 * @author Wang
 * @date 2021/11/9 3:10 下午
 */
public enum DocOccupyStatusEnum {
    PLACED(1, "已下单"),
    OUTED(2, "已出库"),
    CANCELED(3, "已取消");

    private int code;

    private String name;

    DocOccupyStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getName(Integer code) {
        for (DocOccupyStatusEnum c : DocOccupyStatusEnum.values()) {
            if (code.equals(c.getCode())) {
                return c.name;
            }
        }
        return null;
    }
}
